#ifndef _MASTERSERVERINFOPARSER_H_
#define _MASTERSERVERINFOPARSER_H_

#pragma once

#include <Singleton.h>
#include <Define.h>
#include <ServerStruct.h>

class MasterServerInfoParser : public util::Singleton<MasterServerInfoParser>
{
public:
	MasterServerInfoParser(void);
	~MasterServerInfoParser(void);

	BOOL				ParseINI( char *szFileName );

	inline char*		GetMasterServerIP()		{ return m_IoDesc.szIP; }
	inline WORD			GetMasterServerPort()	{ return m_IoDesc.wPort; }
	inline char*		GetAccountDBProxyIP()	{ return m_szAccountDBProxyIP; }
	inline WORD			GetAccountDBProxyPort()	{ return m_wAccountDBProxyPort; }
	inline char*		GetOpServerIP()			{ return m_szOpServerIP; }
	inline WORD			GetOpServerPort()		{ return m_wOpServerPort; }

	INI_IOHANDLER_DESC* GetIoDesc()				{ return &m_IoDesc; }
	SUNLOG_INFO*		GetSunLogInfo()			{ return &m_SunLogInfo; }

private:
	INI_IOHANDLER_DESC	m_IoDesc;
	SUNLOG_INFO			m_SunLogInfo;

	char				m_szAccountDBProxyIP[MAX_IPADDRESS_SIZE + 1];
	WORD				m_wAccountDBProxyPort;
	char				m_szOpServerIP[MAX_IPADDRESS_SIZE + 1];
	WORD				m_wOpServerPort;
};


#endif // _MASTERSERVERINFOPARSER_H_